package managedbean.FRM.CustomerInvoice;

import entity.FRM.CustomerInvoice;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.event.PhaseEvent;
import session.stateless.FRM.CustomerInvoiceBeanLocal;

@ManagedBean(name="viewAllCustomerInvoicesManagerBean")
@ViewScoped

public class ViewAllCustomerInvoicesManagerBean implements Serializable {
    
    public ViewAllCustomerInvoicesManagerBean () {
    }
    
    @EJB
    private CustomerInvoiceBeanLocal customerInvoiceBeanLocal;
    
    private List<CustomerInvoice> customerInvoices = new ArrayList<CustomerInvoice>();

    public List<CustomerInvoice> getCustomerInvoices() {
        return customerInvoiceBeanLocal.getAllCustomerInvoices();
    }

    public void setCustomerInvoices(List<CustomerInvoice> customerInvoices) {
        this.customerInvoices = customerInvoices;
    }
    
    
    public void initView(PhaseEvent event)
    {        
//        if (selectedDeliveryOrder == null)  
//        {
//            selectedDeliveryOrder = (DeliveryOrder) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("selectedDeliveryOrder");                          
//            this.setCustomer(selectedDeliveryOrder.getSaleOrder().getCustomer());
//        }
//    }
    }
    
}
